﻿using Autofac;
using Public_Class_Library;
using System.Reflection;

namespace J.M.Inventory.Read.API.MyAutoFac
{
    public class InventoryAutoFac:Autofac.Module
    {
        //autofac注入
        protected override void Load(ContainerBuilder builder)
        {

            var Repository = Assembly.Load("J.M.Inventory.Infrastruecure");
            var Services = Assembly.Load("J.M.Inventory.Application");
            builder.RegisterAssemblyTypes(Repository).AsImplementedInterfaces();

            builder.RegisterAssemblyTypes(Services).AsImplementedInterfaces();
            //注入单个文件
            builder.RegisterType(typeof(Cross_service_Helper));
            base.Load(builder);
        }
    }
}
